package online.afeibaili.storebackendframework.controller.util

import java.net.URI
import java.net.http.HttpClient
import java.net.http.HttpRequest
import java.net.http.HttpResponse

val client: HttpClient = HttpClient.newHttpClient()

fun keyAndSecretRequest(uri: String): String {
    val request: HttpRequest = HttpRequest.newBuilder(URI(uri)).GET().build()
    val response: HttpResponse<String> = client.send(request, HttpResponse.BodyHandlers.ofString())
    return response.body()
}